package {
	import org.flixel.*;
	public class Particle extends FlxSprite {
		
		private var dieBehavior:ExplodeBehavior;
		public var explodeOnCollision:Boolean;
		public function Particle():void {
			super();
			exists = false;
			explodeOnCollision = false;
		}
		public function spawn(x:int, y:int, img:Class): void {
			this.x = x;
			this.y = y;
			loadGraphic(img);
			exists = true;
		}
		public function die(): void {
			exists = false;
		}
		public function explode(): void {
			dieBehavior.fire(this);
		}
		public function setExplodeBehavior(ex:ExplodeBehavior): void {
			this.dieBehavior = ex;
		}

	}
}

